﻿@page "/Sig"

<div class="row">
    <div class="col-12 col-sm-6">
        <div class="form-label mt-3"></div>
        <SignaturePad OnResult="@OnResult" />
    </div>
    <div class="col-12 col-sm-6">
        @if (!string.IsNullOrEmpty(Result))
        {
            <div class="form-label"></div>
            <img src="@Result" style="height: 240px; width: auto;" alt=""/>
            <div class="form-label"></div>
            <textarea class="form-control" rows="4" @bind="Result"></textarea>
        }
    </div>
</div>

@code
{
    private string? Result { get; set; }
    
    private Task OnResult(string result)
    {
        Result = result;
        StateHasChanged();
        return Task.CompletedTask;
    }
}
